/**
 * Copyright 2018 人人开源 http://www.renren.io
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

package com.tang.common.annotation;

import java.lang.annotation.*;

/**
 * 数据过滤
 *
 * @author Mark 15062230055@163.com
 * @since 3.0.0 201809-17
 */
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface DataFilter {

    /**
     * 表的别名
     */
    String tableAlias() default "";

    /**
     * 注意布尔类型占用的字节，请查看https://www.cnblogs.com/wangtianze/p/6690665.html?utm_source=itdadao&utm_medium=referral
     * true：没有本部门数据权限，也能查询本人数据
     */
    boolean user() default true;

    /**
     * true：拥有子部门数据权限
     */
    boolean subDept() default false;

    /**
     * 部门ID
     */
    String deptId() default "dept_id";

    /**
     * 用户ID
     */
    String userId() default "user_id";
}

